import { IsNotEmpty, IsNumber, Min, IsOptional } from "class-validator";
import { ApiProperty } from "@nestjs/swagger";

export class OrderItemDto {
	@ApiProperty({ description: "商品ID" })
	@IsNotEmpty()
	@IsNumber()
	productId: number;

	@ApiProperty({ description: "商品数量" })
	@IsNotEmpty()
	@IsNumber()
	@Min(1)
	quantity: number;

	@ApiProperty({ description: "SKU ID", required: false })
	@IsOptional()
	@IsNumber()
	skuId?: number;
}
